\name{ct_p_ellipse}
\alias{ct_p_ellipse}
\title{
Plot PTS and GD as ellipses
}
\description{
This functions visualizes a table that has been returned by ct_table(). It uses the PTS and the GD values to calculate and draw ellipses for each team.
}
\usage{
ct_p_ellipse(data, color = c('red', 'green', 'blue'),
             labels = c('outer', 'inner'), savePDF = FALSE, ...)
}
\arguments{
  \item{data}{
a table that has been returned by ct_table()
}
  \item{color}{
either \sQuote{red}, \sQuote{green} or \sQuote{blue}, determines the color of the ellipses
}
  \item{labels}{
either \sQuote{outer} or \sQuote{inner}, changes the placement of the labels
}
  \item{savePDF}{
if provided, stores a PDF to the given path
}
  \item{...}{
any other argument that can be parsed by plot()
}
}
\details{
Both the PTS and the GD values are recalculated to fit a scale from 10 to 100. This is necessary because some GD values are negative. Thus it is not possible to interpret the absolute sizes of the ellipses but only the relations between them. The wider an ellipse the more \dQuote{efficiently} a team has distributed its goals over the matches.

The savePDF argument stores the resulting plot in an A4 PDF file. If you have other requirements, please use your own graphics device and omit the savePDF argument.
}
\examples{
# Load and check the crosstab

data(bundesliga_12_13)
ct_check(bundesliga_12_13)

# Replace the names with abbreviations, recommended if using inner labels

colnames(bundesliga_12_13) <- ct_abbrev(colnames(bundesliga_12_13))
rownames(bundesliga_12_13) <- colnames(bundesliga_12_13)

# Calculate a table from the crosstab

res <- ct_table(bundesliga_12_13)

# Visualize and save the result

ct_p_ellipse(res, color = 'blue', labels = 'inner', savePDF = 'file.pdf')
}
\keyword{ misc }
